#!/usr/bin/perl

$newID = 1;
open(IDS,$ARGV[0]);
while($id=<IDS>) {
	chomp($id);
	$exists{$id} = $newID;
	$newID++;
}
close(IDS);

while($line=<STDIN>) {
	chomp($line);
	@words = split(/\s+/,$line);
	if($exists{$words[0]}) {
		print $exists{$words[0]}."\t".join("\t",@words[1..2])."\n";
	}
}
